package pe.com.cotelasa.scp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the kardex database table.
 *
 */
@Embeddable
public class KardexPK implements Serializable {
    //default serial version id, required for serializable classes.

    private static final long serialVersionUID = 1L;
    @Basic(optional = false)
    @Column(name = "id_empresa")
    private Integer idEmpresa;
    
    @Basic(optional = false)
    @Column(name = "id_sede")
    private Integer idSede;
    
    @Basic(optional = false)
    @Column(name = "id_articulo")
    private Integer idArticulo;
    
    @Basic(optional = false)
    @Column(name = "nu_sec_kardex")
    private Integer nuSecKardex;
    
    @Basic(optional = false)
    @Column(name="partida_lote")
    private String partidaLote;

    public KardexPK() {
    }
    
    public KardexPK(int idEmpresa, int idSede, int idArticulo, int nuSecKardex, String partidaLote) {
        this.idEmpresa = idEmpresa;
        this.idSede = idSede;
        this.idArticulo = idArticulo;
        this.nuSecKardex = nuSecKardex;
        this.partidaLote = partidaLote;
    }

    public Integer getIdEmpresa() {
        return this.idEmpresa;
    }

    public void setIdEmpresa(Integer idEmpresa) {
        this.idEmpresa = idEmpresa;
    }

    public Integer getIdSede() {
        return this.idSede;
    }

    public void setIdSede(Integer idSede) {
        this.idSede = idSede;
    }

    public Integer getIdArticulo() {
        return this.idArticulo;
    }

    public void setIdArticulo(Integer idArticulo) {
        this.idArticulo = idArticulo;
    }

    public Integer getNuSecKardex() {
        return this.nuSecKardex;
    }

    public void setNuSecKardex(Integer nuSecKardex) {
        this.nuSecKardex = nuSecKardex;
    }

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }
        if (!(other instanceof KardexPK)) {
            return false;
        }
        KardexPK castOther = (KardexPK) other;
        return this.idEmpresa.equals(castOther.idEmpresa)
                && this.idSede.equals(castOther.idSede)
                && this.idArticulo.equals(castOther.idArticulo)
                && this.nuSecKardex.equals(castOther.nuSecKardex)
                && this.partidaLote.equals(castOther.partidaLote);
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hash = 17;
        hash = hash * prime + this.idEmpresa.hashCode();
        hash = hash * prime + this.idSede.hashCode();
        hash = hash * prime + this.idArticulo.hashCode();
        hash = hash * prime + this.partidaLote.hashCode();
        hash = hash * prime + this.nuSecKardex.hashCode();

        return hash;
    }
    
    @Override
    public String toString() {
        return "pe.com.cotelasa.scp.entidad.KardexPK[ idEmpresa="+idEmpresa+", idSede=" + idSede + ", idArticulo=" + idArticulo + ", partidaLote=" + partidaLote + ", nuSecKardex="+nuSecKardex +"]";
    }

    public String getPartidaLote() {
        return partidaLote;
    }

    public void setPartidaLote(String partidaLote) {
        this.partidaLote = partidaLote;
    }
}